package com.bulk.timeInterval;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.TimeInterval;
import lombok.SneakyThrows;

import java.util.concurrent.TimeUnit;

/**
 * @author 散装java
 * @date 2022-07-06
 */
public class TimeIntervalTest {
    @SneakyThrows
    public static void main(String[] args) {
        TimeInterval timer = DateUtil.timer();
        timer.start();
        TimeUnit.SECONDS.sleep(1);
        System.out.println(timer.intervalRestart());
        TimeUnit.SECONDS.sleep(1);
        System.out.println(timer.interval());
    }
}
